<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>浏览器弹出层</title>
    </head>
    <body>
        <button id="btnAlert">警告会话框</button>
        <button id="btnConfirm">确认会话框</button>
        <button id="btnPrompt">用户输入会话框</button>

        <script>
            // ·演示警告会话框alert
            btnAlert.onclick = function(){
                // alert("点人家干嘛")
                window.alert("一大波僵尸即将来袭")
            }

            // ·演示确认会话框 confirm确认
            btnConfirm.onclick = function(){
                // 确定则返回true 否则返回false
                var iLike = window.confirm("你喜欢大波僵尸吗?")
                console.log(iLike);
            }

            // ·演示命令提示符会话框 prompt 交互窗口
            btnPrompt.onclick = function(){
                // 捕捉用户的输入
                var userInput = window.prompt("你打算为大波僵尸支付多少钱呢？","100美刀")
                console.log(userInput);
            }  

        </script>
    </body>
</html>
